package bavaria.hightech.banking.gui;

import java.awt.BorderLayout;
import java.awt.Font;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

/**
 * A panel that is loaded into the contentWrapper panel. Displays a form to
 * specify the account number to work with
 * 
 * @author Dietmar
 */
public class PanelSpecifyAccount {

	private GlobalVarsContainer cont;

	public PanelSpecifyAccount(GlobalVarsContainer cont) {
		this.cont = cont;
	}

	public JPanel getJPanel() {

		JPanel panel = new JPanel();
		JLabel labelEnter = new JLabel("Enter account:");
		JLabel labelReview = new JLabel();
		JTextField accNrTextField = new JTextField();
		JButton button = new JButton("Select!");

		labelEnter.setHorizontalAlignment(SwingConstants.CENTER);
		labelEnter.setVerticalAlignment(SwingConstants.CENTER);
		labelEnter.setFont(new Font("sansserif", Font.PLAIN, 12));

		accNrTextField.setColumns(10);
		button.addActionListener(new ListenerSpecifyAccountButton(
				accNrTextField, labelReview, cont));

		panel.add(labelEnter, BorderLayout.NORTH);
		panel.add(accNrTextField, BorderLayout.SOUTH);
		panel.add(button, BorderLayout.SOUTH);
		panel.add(labelReview, BorderLayout.SOUTH);

		return panel;
	}
}
